{extend name="layout/default" /}
{block name="head"}

<title>编辑器demo</title>
{/block}
{block name="content"}
<div class="ok-body">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>Layui编辑器演示</legend>
    </fieldset>

    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">文章内容</label>
            <div class="layui-input-block">
                <textarea name="describe" rows="20" class="layui-textarea editor" placeholder="请输入描述"></textarea>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="scripts"}
<script src="/static/lib/ckeditor4/ckeditor.js" charset="utf-8"></script>
<script type="text/javascript">
    layui.use(["layedit"], function () {
        var $ = layui.jquery;
        var editorList = document.querySelectorAll(".editor");
        if (editorList.length > 0) {
            $.each(editorList, function (i, v) {
                CKEDITOR.replace(
                    $(this).attr("name"), {
                    height: $(this).height(),
                    filebrowserImageUploadUrl: '{:url("upload/uploadEditor")}',
                });
            });
        }
    });
</script>
{/block}